package tianqi.Dao.order;

import java.util.List;
import java.util.Map;
import tianqi.entity.Order;
import tianqi.entity.OrderDetail;
import tianqi.entity.ShareOrder;
import tianqi.entity.UserY;
import tianqi.utils.MyBatisDao;

@MyBatisDao
public interface OrderDao {
	//保存订单信息
	public void saveOrder(Order order);
	
	//保存订单详情
	public void saveOrderDetail(OrderDetail detail);
	
	//在订单生成后，更新库存
	public Integer updateStock(OrderDetail orderDetail);
	
	//根据ID查询订单
	public List<Order> queryOrderByUid(UserY map);
	
	//查询此用户所下订单的总金额
	public Double queryMoneyByUid(UserY map);
	
	//根据订单id删除订单信息
	public void deleteOrderById(Order order);
	
	//根据订单id删除订单详情信息
	public void deleteOrderDetailById(Order order);
	
	//根据订单id 查询此订单所对应的最小销售单元
	public List<OrderDetail> queryOrderDetail(Order order);
	
	//根据订单id 查询此订单所对应的最小销售单元
	public Integer queryStock(Map map);
	
	//根据订单id 更改订单状态
	public Integer updateOrderState(Order order);
	
	//根据订单id 更改订单状态
	public Integer saveShareOrder(ShareOrder order);
	
	//根据订单id 更改订单状态
	public List<ShareOrder> querySoSByUname(UserY order);
	
}
